from homework3 import randint

i = 0
win = 0
lose = 0
while 1:
    num = randint(3, 18)
    str = input("请输入大或小：")
    if 3 <= num <= 10:
        str1 = '大'
    else:
        str1 = '小'
    if str == "exit":
        print("猜的次数为{},胜率为{}%".format(win+lose, 100*win/(win+lose)))
        break
    elif str == str1:
        win += 1
        print("猜对了")
    else:
        lose += 1
        print("猜错了")




